import { CleanWebpackPlugin } from "clean-webpack-plugin";
import HtmlWebpackPlugin from "html-webpack-plugin";
import { join } from "path";
export default {
  mode: "development",
  entry: "./src/index.ts",
  output: {
    filename: "[name].js",
    path: join(__dirname, "dist"),
  },
  resolve: {
    extensions: [".tsx", ".ts", ".vue", ".js"], //省略后缀
  },
  devServer:{
      port:9000
  },
  plugins: [
    new CleanWebpackPlugin(), //打包自动删除dist 需指定output的filename
    //HtmlWebpackPlugin new 一次就是一个页面
    new HtmlWebpackPlugin({
        title:'home',
        template:'./src/index.html',
        
    }),
  ],
};
